<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<!--搜索页面-->

<head th:replace="_fragments :: head(~{::title})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>搜索结果</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
    <link rel="stylesheet" href="../static/css/me.css">
</head>
<body>

    <!--导航-->      <!--inverted 反转  反色-->
    <nav th:replace="_fragments :: menu(1)" class="ui inverted attached segment m-padded-tb-mini">   <!--引入m-padded-tb-mini  在me.css中自定义导航栏-->
        <div class="ui container">          <!--让logo不那么靠左边-->
            <div class="ui inverted secondary stackable menu">     <!--stackable可堆叠 响应手机端 APP访问-->
                <h2 class="ui teal header item">LinYD</h2>    <!--导航栏上的logo   teal一种颜色-->
                <!--m-mobile-hide手机端隐藏-->
                <a href="#" class="m-item item m-mobile-hide"><i class="home icon"></i> 首页</a>   <!--<i class="home icon"></i>在条目前加上相应的图标-->
                <a href="#" class="m-item item m-mobile-hide"><i class="idea icon"></i> 分类</a>
                <a href="#" class="active m-item item m-mobile-hide"><i class="tags icon"></i> 标签</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="time icon"></i> 归档</a>
                <a href="#" class="m-item item m-mobile-hide"><i class="info icon"></i> 关于我</a>

                <div class="right m-item item m-mobile-hide">   <!--right item 让此条目靠右-->
                    <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                        <div class="ui icon inverted transparent input m-margin-tb-tiny">
                            <input type="text" name="query" placeholder="Search...." th:value="${query}">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </form>
                </div>

                <div class="right m-item item m-mobile-hide">   <!--right item 让此条目靠右-->
                    <a href="#" class="item">登录</a>
                    </div>
                <div class="right m-item item m-mobile-hide">   <!--right item 让此条目靠右-->
                    <a href="#" class="item">注册</a>
                </div>
                </div>


            </div>
        </div>
        <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">  <!--m-right-top 将此按钮定义到右上-->  <!--m-mobile-show pc端隐藏 app展示-->
            <i class="sidebar icon"></i>
        </a>

    </nav>

    <!--中间内容-->
    <div class="m-container-small m-padded-tb-big">
        <div class="ui container">
            <!--头部-->
            <div class="ui top attached segment"> <!--top attached 和 attached可以让头部和列表连接起来-->
                <div class="ui middle aligned two column grid">   <!--两列-->  <!--middle aligned 垂直方向居中-->
                    <div class="column">
                        <h3 class="ui teal header">搜索结果</h3>
                    </div>

                    <div class="right aligned column">
                        共 <h2 class="ui orange header m-inline-block m-text-thin" th:text="${page.totalElements}">10</h2> 个   <!--m-inline-block定义不换行-->
                    </div>
                </div>
            </div>



            <br>
            <br>

            <!--博客列表-->
                <div class="ui attached segment">
                    <div class="ui m-padded-tb-big vertical segment m-padded-tb-big" th:each="blog : ${page.content}">
                        <div class="ui middle aligned mobile reversed stackable grid" >     <!--mobile reversedAPP访问 顺序反转，图片在前-->
                            <div class="eleven wide column">
                                <h3 class="ui header"><a href="#" th:herf="@{/blog/{id}{id=${blog.id}}}" target="_blank" class="m-black" th:text="${blog.title}">Java面试热门八股文</a></h3>
                                <p class="m-text" th:text="|${blog.description}......|">Java高频面试题，帮助你轻松回答面试官的问题，提高拿offer的成功率Java高频面试题，
                                    帮助你轻松回答面试官的问题，提高拿offer的成功率Java高频面试题......</p>

                                <div class="ui grid">
                                    <div class="ui eleven wide column">
                                        <div class="ui horizontal link list">
                                            <div class="item">
                                                <img src="../static/images/tou%20xiang.jpg" th:src="@{/images/tou%20xiang.jpg}"  alt="" class="ui avatar image">
                                                <div class="content"><a href="#" class="header" th:text="${blog.user.nickname}">林耀东</a></div>   <!--作者-->
                                            </div>
                                            <div class="item">
                                                <i class="calendar icon"></i><span th:text="${#dates.format(blog.updateTime,'yyyy-MM-dd')}">2022-5-3</span>    <!--发表时间-->
                                            </div>
                                            <div class="item">
                                                <i class="eye icon"></i><span th:text="${blog.views}">5 </span>         <!--浏览次数-->
                                            </div>
                                        </div>
                                    </div>
                                    <div class="ui right aligned five wide column">
                                        <a href="#" target="_blank" class="ui teal m-padded-mini label" th:text="${blog.type.name}">Java面试</a>
                                    </div>
                                </div>
                            </div>

                            <div class="five wide column">
                                    <a href="#" th:herf="@{/blog/{id}{id=${blog.id}}}" target="_blank">
                                    <img src="https://picsum.photos/id/191/800/550" th:src="@{${blog.firstPicture}}" alt="" class="ui rounded image">
                                </a>
                            </div>
                        </div>
                    </div>
                </div>

            <div class="ui bottom attached segment" th:if="${page.totalPages}>1">
                <div class="ui middle aligned two column grid">   <!--两列-->  <!--middle aligned 垂直方向居中-->
                    <div class="column">
                        <a href="#" th:href="@{/(page=${page.number}-1)}" th:unless="${page.first}" class="ui teal basic button">上一页</a>
                    </div>

                    <div class="right aligned column">
                        <a href="#" th:href="@{/(page=${page.number}+1)}" th:unless="${page.last}" class="ui teal basic button">下一页</a>
                    </div>
                </div>
            </div>

        </div>
    </div>


    <!--底部footer-->
    <footer th:replace="_fragments :: footer" class="ui inverted vertical segment m-padded-tb-massive">  <!--m-padded-tb-massive  自定义底部宽度-->
        <div class="ui center aligned container">
            <div class="ui inverted divided stackable grid">  <!--布局 列-->   <!--divided 列分割线-->
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/wechat.jpg" class="ui rounded image" alt="" style="width: 120px">   <!--设置底部微信二维码-->
                        </div>
                    </div>
                </div>

                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">最新博客</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">Java面试最热八股文</a>
                        <a href="#" class="item">Java基础过一遍</a>
                        <a href="#" class="item">SpringBoot的常用组件</a>
                    </div>
                </div>

                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                    <div class="ui inverted link list">
                        <a href="#" class="item">Email：940951719@qq.com</a>
                        <a href="#" class="item">QQ：940951719</a>
                        <a href="#" class="item">Wechat：Lyd_2166</a>
                    </div>
                </div>

                <div class="seven wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">LinYD</h4>
                    <p class="m-text-thin m-text-spaced m-opacity-mini">这是我的个人博客，用来分享我的一些编程学习笔记和心得等内容，希望这些内容对看到的人有所帮助</p>

                </div>

            </div>
            <div class="ui inverted section divider"></div>   <!--底部分割线-->
            <p class="m-text-thin m-text-spaced m-opacity-mini">Copyright@2022-2023 LinYD Designed by LinYD</p>
        </div>

    </footer>

    <script src="../static/lib/jQuery/jQuery.js" th:src="@{/js/jQuery.js}"></script>
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>

    <!--点击事件，在手机端点击按钮后显示原本隐藏的目录-->
    <script>
        $('.menu.toggle').click(function (){
           $('.m-item').toggleClass('m-mobile-hide');
        });


    </script>
</body>
</html>